package cn.tedu.csmallproductzxj.controller;

import cn.tedu.csmallproductzxj.ex.ServiceException;
import cn.tedu.csmallproductzxj.pojo.dto.AttributeTemplateUpdateDTO;
import cn.tedu.csmallproductzxj.pojo.dto.BrandAddNewDTO;
import cn.tedu.csmallproductzxj.pojo.dto.BrandUpdateDTO;
import cn.tedu.csmallproductzxj.pojo.vo.AttributeTemplateStandardVO;
import cn.tedu.csmallproductzxj.pojo.vo.BrandStandardVO;
import cn.tedu.csmallproductzxj.service.IBrandService;
import cn.tedu.csmallproductzxj.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.Range;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/brands")
@Api(tags = "02. 品牌管理模块")
@Validated
public class BrandController {

//    @Autowired
//    private IBrandService brandService;
//
//    @PostMapping("/add_new")
//    @ApiOperation("添加品牌")
//    @ApiOperationSupport(order = 100)
//    public JsonResult addNew(@Valid BrandAddNewDTO brandAddNewDTO){
//        brandService.addNew(brandAddNewDTO);
//        return JsonResult.ok();
//    }
//
//    @GetMapping("/{id:[0-9]+}")
//    @ApiOperation("根据ID查询品牌详情")
//    @ApiOperationSupport(order = 200)
//    public JsonResult getStandardById(@Range(min = 1, message = "获取详情失败，ID值无效！")
//                                      @PathVariable Long id){
//        BrandStandardVO queryResult= brandService.getStandardById(id);
//        return JsonResult.ok(queryResult);
//    }
//
//    @PostMapping("/{id:[0-9]+}/delete")
//    @ApiOperation("根据ID删除品牌详情")
//    @ApiOperationSupport(order = 300)
//    public JsonResult deleteBrandById(@Range(min = 1, message = "获取详情失败，ID值无效！")
//                                                        @PathVariable Long id){
//        brandService.deleteBrandById(id);
//        return JsonResult.ok();
//    }
//
//    @PostMapping("{id:[0-9]+}/update")
//    @ApiOperation("修改品牌详情")
//    @ApiOperationSupport(order = 400)
//    @ApiImplicitParams(value = {
//            @ApiImplicitParam(name = "id", value = "相册ID", required = true, dataType = "long"),
//    })
//    public JsonResult updateInfoById(@Range(min = 1, message = "修改相册详情失败，ID值无效！")
//                                     @PathVariable Long id, @Valid BrandUpdateDTO brandUpdateDTO) {
//        brandService.updateInfoById(id,brandUpdateDTO);
//        return JsonResult.ok();
//
//    }


}